<div id="chords_header">
	<ul>
		<li><a href="javascript:void(0);" class="menu active" onclick="javascript:chords_active(this);">คอร์ด</a></li>
		<li><a href="javascript:void(0);" class="menu" onclick="javascript:chords_active(this);">แท็ปกีต้าร์</a></li>
	</ul>	
	<div id="info">
		<div class="image">
			<?php echo exec_image(array(
				'folder' => ''.($dataResult->song_id ? 'album':'chords').'',
				'dimension' => '120x120',
				'file_name' => $dataResult->album_file_name.'.'.$dataResult->album_file_ext,
				'alt' => ''.$dataResult->song_name.'',	
				'title' => ''.$dataResult->song_name.''	
				)
			);?>		
		</div>
		<div class="detail">
			<h2>เพลง <?php echo $dataResult->song_name;?></h2>
			<div>ศิลปิน : <a href="<?php echo $chord_url.'artist/'.seo_url($dataResult->artist_name);?>" target="_self"><?php echo $dataResult->artist_name;?></a></div>
			<div>อัลบั้ม : <?php echo $dataResult->album_name;?></div>
			<div>แนวเพลง : <?php echo $dataResult->genre_tag;?></div>
			<div class="dashed"></div>
			<!--Facebook Plugin-->
			<?php echo $module_facebook_plugins_share;?>
		</div>
		<div id="music_play_object">
			<?php if(!empty($dataResult->song_embed)):?>
				<?php echo $dataResult->song_embed;?>
			<?php else:?>
				<!--Vdo Player-->
				<div id="vdoPlayer">
					<?php if($this->agent->is_mobile()):?>
						<video id='my_video' controls preload='none'></video>
					<?php endif;?>
				</div>
			<?php endif;?>
		</div>
		<div class="clear"></div>
	</div>
</div>
<div id="left_side">
	<div id="chords_play">
		<div class="chords_image">	
			<?php if(!empty($dataResult->chords_image)):?>
				<div class="elementToPrint">
					<a href="javascript:void(0);" title="พิมพ์หน้านี้" alt="พิมพ์หน้านี้" class="print"></a>
					<ul>
						<?php $chords_arr = explode(':',$dataResult->chords_used);?>
						<?php foreach($chords_arr as $value):?>
							<li><?php echo image_asset('chords/chords_table/'.$value.'.png','',array('height' => 95));?></li>
						<?php endforeach;?>
					</ul>
					<?php foreach($dataResult->chords_image as $value):?>
						<?php echo image_asset('../uploads/chords/images/original/'.$value->chords_file_name.'.'.$value->chords_file_ext,'',array('width' => 660));?>
					<?php endforeach;?>
				</div>
			<?php else:?>
				<div class="empty">ขออภัย ยังไม่มีข้อมูลค่ะ</div>
			<?php endif;?>
		</div>
		<div class="chords_tabs_image">
			<?php if(!empty($dataResult->tabs_image)):?>
				<div class="elementToPrint">
					<a href="javascript:void(0);" title="พิมพ์หน้านี้" alt="พิมพ์หน้านี้" class="print"></a>
					<?php foreach($dataResult->tabs_image as $value):?>			
						<?php echo image_asset('../uploads/chords/images/original/'.$value->tabs_file_name.'.'.$value->tabs_file_ext,'',array('width' => 660));?>
					<?php endforeach;?>
				</div>
			<?php else:?>
				<div class="empty">ขออภัย ยังไม่มีข้อมูลค่ะ</div>
			<?php endif;?>		
		</div>		
	</div>
</div>
<div id="right_side">
	<!--Module-->
	<?php
	if(!empty($module))
	foreach($module as $value):?>
	<?php echo $value;?>
	<?php endforeach;?>
</div>
<?php if(empty($dataResult->song_embed)): //if no embed load jwplayer?>
<script type="text/javascript" language="javascript">
(function($) {
/*whatever jQuery stuff*/
	$(function(){
		var is_mobile = '<?php echo $this->agent->is_mobile();?>';
		var url = "<?php echo other_asset_url('uploads/song/files/'.date('Y/m/d',strtotime($dataResult->song_create_date)).'/'.$dataResult->song_file_name.'.'.$dataResult->song_file_ext);?>";
		if(is_mobile){
			//Set Video Source
			$('#my_video').append("<source id='mp3' src='"+url+"' type='audio/mp3'>");
			$('#my_video').attr('src',""+url+"");
			$('#my_video').attr('width',250);
			$('#my_video').attr('height',120);		
			// videoplaza sdk, 4 sec time-out, callback function
/*			loadScript("<?php echo js_asset_url('media/html5-sdk-1.0.12.15.1-ea.min.js');?>",4000,initVideoplaza);*/
			// *** START - videoplaza plugin config ***
/*			vpConfig = {
				vphost : 'http://th-pmdplus.videoplaza.tv',
				category : 'music',
				tags : ['standard'],
				flags: [],
				playbackPosition: [] // mid-roll cue points, if any.
			}*/
			// *** END - videoplaza plugin config ***
			//Auto Play && Loop
/*			$('#my_video').attr('autoplay','autoplay');	*/
		} else {
			jwplayer("vdoPlayer").setup({
				autostart: false,
		      	flashplayer: "<?php echo js_asset_url('media/player.swf');?>",
		      	width: 250,
		      	height: 120,
				file: ""+url+"",
				image: "<?php echo other_asset_url('uploads/album/images/original/'.@$dataResult->album_file_name.'.'.@$dataResult->album_file_ext);?>",
		      	plugins: "<?php echo js_asset_url('media/vp_plugin.swf');?>",
		      	//vpdomain: "http://th-pmdplus.videoplaza.tv",
		      	//vpshares: "music",
		      	//vptags: "",
				//closebuttontimeout: 5				
			});		
		}
		
		$(".print").click(function(){
			$(this).parent().printArea({
				mode: "popup",
				popWd: 660,
				popClose: true		
			});
        });
	});	
})(jQuery);

</script>
<?php endif;?>